<template>
    <div class="left-box">
        <div class="search-box">
            <el-date-picker v-model="date" type="date" placeholder="选择日期" class="picker-box">
            </el-date-picker>
            <el-select v-model="area" slot="prepend" placeholder="请选择">
                <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
                </el-option>
            </el-select>
        </div>
        <el-tabs v-model="activeName">
            <el-tab-pane label="底图" name="0">
                <el-tree :data="data" :props="defaultProps" @node-click="handleNodeClick" :highlight-current="true">
                    <span :class="node.level == 1 ? 'custom-tree-node' : 'tree-node'" slot-scope="{ node }">
                        <img :src="node.expanded ? require('@/assets/img/folder-open-fill.png') : require('@/assets/img/folder-fill.png')"
                            v-if="node.level == 1" />
                        <span>{{ node.label }}</span>
                    </span>
                </el-tree>
            </el-tab-pane>
            <el-tab-pane label="图层" name="1">
                <div class="left-menu">
                    <div class="menu-name" :class="menu === '沿街商铺' && 'menu-name-choice'" @click="setMemu('沿街商铺')">
                        沿街商铺</div>
                    <div class="menu-name" :class="menu === '小区' && 'menu-name-choice'" @click="setMemu('小区')">小区
                    </div>
                    <div class="menu-name" :class="menu === '渠道' && 'menu-name-choice'" @click="setMemu('渠道')">渠道
                    </div>
                </div>
            </el-tab-pane>
        </el-tabs>
    </div>
</template>
<script>
export default {
    data() {
        return {
            menu: '',
            isDrag: false,
            data: [{
                label: '区域面',
                children: [{
                    label: '市',
                }, {
                    label: '区县',
                }, {
                    label: '乡镇',
                }, {
                    label: '网格',
                }]
            },
            {
                label: '道路',
                children: [{
                    label: '道路1',

                }, {
                    label: '道路2',

                }]
            },
            {
                label: '标注',
                children: [{
                    label: '建筑',

                }, {
                    label: '餐饮',

                }, {
                    label: '购物娱乐',

                }, {
                    label: '景区',

                }, {
                    label: '交通设施',

                }, {
                    label: '科教文化',

                }, {
                    label: '公共服务',

                }, {
                    label: '医疗保险',

                }, {
                    label: '休闲体育',

                }, {
                    label: '道路节点',

                }, {
                    label: '金融保险',

                }, {
                    label: '摩托车服务',

                }, {
                    label: '汽车服务',

                }]
            }
            ],
            defaultProps: {
                children: 'children',
                label: 'label'
            },
            activeName: '',
            date: '',
            area: '1002',
            checkList: [],
            options: [{
                value: '1002',
                label: '哈尔滨市‌'
            }, {
                value: '1003',
                label: '齐齐哈尔市'
            }, {
                value: '1004',
                label: '牡丹江市'
            }, {
                value: '1005',
                label: '佳木斯市'
            }, {
                value: '1006',
                label: '大庆市'
            }, {
                value: '1007',
                label: '伊春市‌'
            }, {
                value: '1008',
                label: '鸡西市‌'
            }, {
                value: '1009',
                label: '鹤岗市‌'
            }, {
                value: '1010',
                label: '双鸭山市'
            }, {
                value: '1011',
                label: '‌七台河市‌'
            }, {
                value: '1012',
                label: '绥化市‌'
            }, {
                value: '1013',
                label: '黑河市‌'
            }, {
                value: '1014',
                label: '大兴安岭'
            }],
        }
    },
    methods: {
        handleNodeClick(node) {
            console.log('node', node)
        },
        setMemu(menu) {
            this.menu = menu;
        },
    }
}
</script>
<style lang="scss" scoped>
.page {
    width: 100%;
    height: 100%;
    position: relative;
}

.left-box {
    width: 300px;
    height: 100%;
    background: #fff;
    position: absolute;
    top: 0px;
    left: 0px;
    z-index: 999;

    ::v-deep .el-tabs__item {
        width: 150px;
        text-align: center;
        padding: 0;
        font-size: 16px;
    }

    ::v-deep .el-tabs__item.is-active {
        color: #000;
        background: #ebf5ff;
    }
}

#map {
    width: 100%;
    height: 100%;
}

.noDrew {
    position: absolute;
    left: 310px;
    top: 10px;
    background: #fff;
    width: 70px;
    height: 70px;
    z-index: 999;
    text-align: center;
    cursor: pointer;

    img {
        margin-top: 12px;
    }

    .text {
        font-size: 14px;
        margin-top: 3px;
    }

    &:hover {
        background: rgb(235, 245, 255);
    }
}

.isDrag {
    position: absolute;
    right: 410px;
    top: 10px;
    background: #fff;
    width: 70px;
    height: 70px;
    z-index: 999;
    text-align: center;
    cursor: pointer;

    img {
        margin-top: 12px;
    }

    .text {
        font-size: 14px;
        margin-top: 3px;
    }

    &:hover {
        background: rgb(235, 245, 255);
    }
}

.isDrew {
    position: absolute;
    left: 310px;
    top: 10px;
    background: #3d9dfe;
    width: 70px;
    height: 70px;
    z-index: 999;
    text-align: center;
    cursor: pointer;

    img {
        margin-top: 12px;
    }

    .text {
        color: #fff;
        font-size: 14px;
        margin-top: 3px;
    }
}

.drew {
    position: absolute;
    left: 390px;
    top: 10px;
    width: 350px;
    height: 70px;
    background: #fff;
    z-index: 999;
    display: flex;
}

.drew-item {
    width: 70px;
    text-align: center;
    cursor: pointer;

    img {
        width: 26px;
        margin-top: 12px;
    }

    &:hover {
        background: rgb(235, 245, 255);
    }
}

.drew-btn {
    font-size: 14px;
    margin-top: 3px;
}

.drew-item-active {
    background: rgb(235, 245, 255);
}

.right-box {
    width: 400px;
    height: 100%;
    background: #fff;
    position: absolute;
    top: 0px;
    right: 0px;
    z-index: 999;
    padding-left: 10px;

    ::v-deep .el-input-group__prepend {
        width: 120px;
        background-color: #ebf5ff;
        border: 0;
        border-right: 1px solid #ddd;
        border-radius: 12px 0 0 12px;
    }

    ::v-deep .el-input-group__prepend div.el-select .el-input__inner {
        color: #000;
    }

    ::v-deep .el-input-group__append {
        background-color: #ebf5ff;
        border: 0;
        color: #4ea2fa;
        font-size: 18px;
    }

    ::v-deep .el-input__inner {
        background-color: #ebf5ff;
        border: 0;
        height: 46px;
    }

    ::v-deep .el-input-group {
        height: 46px;
    }
}

.list-box {
    width: 375px;
    height: 430px;
    position: absolute;
    top: 10px;
    right: 410px;
    z-index: 999;
    background: #fff;
    padding: 0 16px;

    .el-icon-close {
        position: absolute;
        right: 10px;
        top: 10px;
        cursor: pointer;
        color: #999;
        background-color: #fff;
    }

    .list-box-inset {
        width: 358px;
        height: 427px;
        overflow-y: auto;

        /*定义滚动条高宽及背景 高宽分别对应横竖滚动条的尺寸*/
        &::-webkit-scrollbar {
            width: 6px;
            background-color: transparent;
        }

        /*定义滚动条轨道 内阴影+圆角*/
        &::-webkit-scrollbar-track {
            border-radius: 10px;
            background-color: transparent;
        }

        /*定义滑块 内阴影+圆角*/
        &::-webkit-scrollbar-thumb {
            border-radius: 10px;
            background-color: #eee;
        }
    }

    .list-item {
        height: 104px;
        width: 100%;
        border-bottom: 1px solid #ccc;
        display: flex;
        flex-wrap: nowrap;

        img {
            width: 85px;
            height: 85px;
            margin-top: 11px;
            margin-right: 10px;
        }

        .title {
            font-weight: 900;
            line-height: 30px;
            margin-top: 12px;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            width: 230px;
        }

        .address {
            color: #777;
            font-size: 14px;
            line-height: 26px;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            width: 230px;
        }

        .phone {
            color: #777;
            font-size: 14px;
            line-height: 26px;
        }
    }
}

.type-box {
    width: 165px;
    height: 322px;
    overflow-y: auto;
    position: absolute;
    bottom: 10px;
    right: 410px;
    z-index: 999;
    background: #fff;
    padding: 8px 16px;

    .type-item {
        height: 34px;
        line-height: 34px;
        cursor: pointer;
    }

    img {
        float: right;
        margin-top: 6px;
    }
}

.search-title {
    width: 90px;
    height: 50px;
    text-align: center;
    line-height: 50px;
    border-radius: 20px 0 0 0;
    background: #ebf5ff;
    float: right;
    font-weight: bold;
}



.search-list {
    background: #ebf5ff;
    width: 100%;
    height: calc(100% - 120px);
    overflow-y: auto;
    margin-top: 10px;
    border-radius: 12px 0 0 12px;
    padding: 16px 0;

    .search-item {
        padding: 0 10px;
        line-height: 40px;
        font-size: 15px;
        cursor: pointer;

        &:hover {
            background: #fff;
        }

        img {
            position: relative;
            top: 5px;
        }

        .name {
            margin-left: 8px;
        }

        .address {
            color: #666;
            margin-left: 8px;
        }

        .len {
            color: #666;
            float: right;
        }
    }
}

::v-deep .el-checkbox {
    font-size: 16px;
}

.search-box {
    display: flex;
    padding: 10px;

    .picker-box {
        width: 230px;
        margin-right: 10px;
    }
}

.custom-tree-node,
.tree-node {
    font-size: 14px;

    img {
        margin-right: 10px;
        position: relative;
        top: 5px;
    }
}

.left-menu {
    .menu-name {
        height: 50px;
        line-height: 50px;
        width: 100%;
        padding: 0 16px;
        cursor: pointer;
        font-size: 14px;

        &:hover {
            background: rgb(245, 247, 250);
        }
    }

    .menu-name-choice {
        background: rgb(235, 245, 255);
    }
}

::v-deep .el-tree-node__content {
    background: #ebf5ff;
    height: 36px;
    line-height: 36px;
}

::v-deep .el-tree-node__children .el-tree-node__content {
    background: #fff;

    &:hover {
        background: rgb(245, 247, 250);
    }
}

::v-deep .el-tabs__header {
    margin: 0;
}
</style>